<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateRechargesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('recharges', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('userid')->comment('用户id');
            $table->decimal('money', 16, 2)->comment('充值金额');
            $table->decimal('fee', 16, 2)->default(0.00)->comment('服务费');
            $table->decimal('actualmoney', 16, 2)->default(0.00)->comment('充值实付金额');
            $table->tinyInteger('status')->comment('充值状态');
            $table->string('path')->comment('充值来源');
            $table->string('rechargenumber')->unique()->nullable()->comment('充值订单号');
            $table->string('payshopnumber')->unique()->nullable()->comment('支付商家反馈订单号');
            $table->decimal('doublemoney', 16,2)->comment('翻贝金额');
            $table->tinyInteger('doublestatus')->default(0)->comment('翻贝状态');
            $table->tinyInteger('isdoublecoupons')->default(0)->comment('是否使用翻倍券');
            $table->dateTime('doubletime')->comment('预计翻贝到达时间');
            $table->tinyInteger('sharestatus')->default(0)->comment('分享状态');
            $table->string('note')->default('')->comment('充值备注');
            $table->integer('adminid')->comment('操作员ID');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('recharges');
    }
}
